<%@ page language="java" contentType="text/html; charset=utf8"
	pageEncoding="utf8"%>
<%@taglib uri="http://www.springframework.org/tags" prefix="spring"%>
<%@taglib uri="http://www.springframework.org/tags/form" prefix="form"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
	<link type="text/css" href="resources/css/jquery-ui.css" 		rel="stylesheet" />
	<link type="text/css" href="resources/css/flexigrid.css" 		rel="stylesheet">
	<link type="text/css" href="resources/css/main.css" 			rel="stylesheet"/>
	<link type="text/css" href="resources/css/ui.jqgrid.css"  media="screen" 	rel="stylesheet" />
	
	<script type="text/javascript" src="resources/jquery.min.js"></script>
	<script type="text/javascript" src="resources/jquery-ui.min.js"></script>
	<script type="text/javascript" src="resources/flexigrid.js"></script>
	
	<script type="text/javascript" src="resources/i18n/grid.locale-en.js" ></script>
	<script type="text/javascript" src="resources/jquery.jqGrid.src.js" ></script>
	<script type="text/javascript" src="https://maps.google.com/maps/api/js?sensor=true"></script>
	<script type="text/javascript" src="resources/jquery.ui.map.full.min.js" ></script>

<script type="text/javascript">
$(document).ready(function() { 
	$.ajaxSetup({cache:false});
//JSON-Call server for main menu creation 
	$.ajax({
			cache: false,
			url:	'json/menu/a', 
			success:	function(data) {
					  var items = [];
					  var contents = [];
					  $.each(data, function(key, val) {
						  					if (key=="menuItems"){
						  						$.each(val, function(index,val) {
						  							items.push('<li><a href="#tabs-'+index+'">' + val + '</a></li>');		
						  						});
						  					}
						  					if (key=="menuContents"){
						  						$.each(val, function(index,val) {
						  							contents.push('<div id="tabs-'+index+'"></div>');		
						  						});
						  					}			  					
					  			});
					  $('<ul/>', 	{html:    items.join('')}).appendTo("#mainMenu");
					  $('<div/>', 	{html: contents.join('')}).appendTo("#mainMenu");
					  
					  $("#mainMenu").tabs();
					  $("#mainMenu").height($(document).height()-155);
					  
					  //Load Tab Content
						$("#mainMenu").tabs("url",0,"user/advertisingRegistryList");
						$("#mainMenu").tabs("url",1,"user/basketList");
						$("#mainMenu").tabs("url",2,"user/orderList");
						$("#mainMenu").tabs("load",$("#mainMenu").tabs( "option", "selected" ));
						}
	
		});	
}); 
</script>	
<title><spring:message code="label.title" /></title>
</head>
<body title="User's Main Form">
	<div id="header">
	  <div class="center">
	    <div id="logo"><a href="#">STANDART</a></div>
	   </div>
	</div>
	<a href="<c:url value="/logout" />"> <spring:message code="label.logout" /> </a> 
	<button id="addTabButton" style="visibility:hidden;" > Add Tab </button>	<br>	
	
	
	
	<div id=mainMenu style="font-size: 0.9em;"> </div>
	

</body>
</html>